#!/usr/bin/python
import time
import subprocess
import sys

from control import *

#setting for rpc
#workaround ipython sys.argv behavior
args = 'control'
hardware_settings_load()
(s, d) = debug_connection_start()
d = ExceptionWrapper(d, rpc_exc_handler)
serial_rpc_reset(s)

#acs setup and wait
#d.portd_set(0xff)
#setup
d.acs_setup()
time.sleep(2)

#testing
while 1:
    print "fan testing"
    d.fan_set(1)
    time.sleep(1)
    d.acs_throw_one()
    d.fan_set(0)
    time.sleep(1)
    d.acs_throw_two()
    time.sleep(0.5)

d.acs_end()

print "It's finish, Heron.\n"
